import config from '@/utils/config';
import { MockMethod } from 'vite-plugin-mock';

const login = {
  url: config.url.login,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: {
        token: 'token',
        userInfo: {
          id: 1,
          username: '13766668888',
          nickname: 'aster',
          avatar:
            'https://img2.baidu.com/it/u=1434094524,2760823040&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=500',
          email: 'aster1004@163.com',
          gender: 'M',
          birthday: '1992-10-04',
          area: '',
          signature: '快乐的搬运工',
        },
      },
      message: 'success',
    };
  },
};

// 发送验证码
const sendCode = {
  url: config.url.send_code,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: 'success',
      message: 'success',
    };
  },
};

// 校验验证码
const validateCode = {
  url: config.url.validate_code,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: 'success',
      message: 'success',
    };
  },
};

// 重置密码
const resetPassword = {
  url: config.url.reset_pwd,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: 'success',
      message: 'success',
    };
  },
};

// 注册
const register = {
  url: config.url.register_user,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: 'success',
      message: 'success',
    };
  },
};

// 更换手机
const replaceMobile = {
  url: config.url.relpace_mobile,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: 'success',
      message: 'success',
    };
  },
};

// 更换手机
const logout = {
  url: config.url.logout,
  method: 'post',
  response: () => {
    return {
      code: 200,
      data: 'success',
      message: 'success',
    };
  },
};

export default [
  login,
  sendCode,
  validateCode,
  resetPassword,
  register,
  replaceMobile,
  logout,
] as MockMethod[];
